#!/usr/bin/python
#encoding: utf-8
import socket
from base import *
from optparse import OptionParser

def main():
    '''Main函数只用来起socket监听本地Host'''
    cf = Cf()
    svnsync = SvnSync()

    HOST = cf.get_bind_host()
    PORT = cf.get_bind_port()

    s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    try:
        s.bind((HOST,PORT))
    except socket.error,msg:
        print "Bind failed Error Code is:" + str(msg[0]) + "Message:" + msg[1]
        sys.exit()
    s.listen(1)

    svnsync.connect_server()

    s.close()



if __name__ == "__main__":
    
    main()
